// Sizer.h: interface for the CSizer class.
//
//////////////////////////////////////////////////////////////////////
#include <vector>

///////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////

#if !defined(AFX_SIZER_H__41AB7E94_2BD3_4C14_88A0_502AD06960BB__INCLUDED_)
#define AFX_SIZER_H__41AB7E94_2BD3_4C14_88A0_502AD06960BB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CSizer;
class CSizerCollection
{
/*
public:
	CSizerCollection() {}
*/	
public:		
	CSizerCollection(HWND hParentWindow);
	void Add(CSizer* pItem);
	void RecalcLayout(int iNewParentWidth, int iNewParentHeight) const;
	void VerifyDragRectangle(WPARAM wParam, LPARAM lParam);

	virtual ~CSizerCollection();
private:
	std::vector<CSizer*> m_vecCollection;
	SIZE m_szParentWindow;
};

class CSizer  
{
friend class CSizerCollection;	
public:
	enum ResizeMode	{	FIXED		= 0x01,
						HORIZONTAL	= 0x02, 
						VERTICAL	= 0x04,	
						BOTH		= HORIZONTAL | VERTICAL	};			

public:
	CSizer(HWND hControl, HWND hParentWindow, ResizeMode ResizeMode);
	virtual ~CSizer();

private:
	void RecalcLayout(int iNewWidth, int iNewHeight) const;

private://init
	HWND		m_hControl;
	ResizeMode	m_ResizeMode;

private://work	
	POINT		m_ptInitialControlTopLeft;
	SIZE		m_szInitialControlSize;
	SIZE		m_szInitialParentSize;
};

#endif // !defined(AFX_SIZER_H__41AB7E94_2BD3_4C14_88A0_502AD06960BB__INCLUDED_)
